const Axios = require('axios').default
const https = require('https')
const fs = require('fs')

const privateKey = fs.readFileSync('./ssl/server_key.pem').toString()
const certificate = fs.readFileSync('./ssl/server.cer').toString()

const IP = '10.33.123.167'

const url = `https://10.26.0.222:30100/v4/default/registry/microservices/00899f7ec8ab73aac724ee16a64922aba86c6d67/providers`;
const governUrl = `https://10.26.0.222:30100/v4/default/govern/microservices`;
// const IP = '10.33.123.167'

Axios.get(governUrl, {
  headers: {
    'Content-Type': 'application/json',
    'x-domain-name': 'default'
  },
  httpsAgent: new https.Agent({
    rejectUnauthorized: false,
    cert: certificate,
    key: privateKey,
    passphrase: 'Changeme_123'
  })
}).then(resp => {
  console.log(JSON.stringify(resp.data))
}).catch(err => {
  console.log(err)
})
